<nav id="navbar" class="navbar navbar-default navbar-static-top" role="navigation">
    <div class="container">
        <div class="navbar-header">
            <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="logo" href="{{.AppUrl}}">
                <img src="{{.AppLogo}}">
            </a>
        </div>
        {{if .SearchEnabled}}
        <form id="navbar-search" class="navbar-form navbar-left" role="search" action="{{.AppUrl}}search" method="GET">
            <div class="form-group">
                <input class="form-control search-box" type="text" placeholder="{{i18n .Lang "search"}}" name="q" id="st-search-input">
            </div>
        </form>
        {{end}}
        <div class="collapse navbar-collapse navbar-ex1-collapse">
            <ul class="nav navbar-nav">
                <li><a href="{{.AppUrl}}">{{i18n .Lang "home"}}</a></li>
                <!--<li><a href="{{.AppUrl}}column">{{i18n .Lang "column"}}</a></li>-->
                <li class="dropdown">
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown">{{i18n .Lang "tool"}} <span class="caret"></span></a>
                    <ul class="dropdown-menu" role="menu">
                        <li><a href="http://gopm.io" target="_blank">{{i18n .Lang "gopm"}}</a></li>
                    </ul>
                </li>
            </ul>
            
            {{if .IsLogin}}
            <ul class="nav navbar-nav navbar-right">
                {{if .UnreadNotificationCount}}
                <li>
                    <a href="{{.AppUrl}}notification">{{i18n .Lang "notice.unread_notice"}} <span class="badge" style="vertical-align:top;">{{.UnreadNotificationCount}}</span></span></a>
                </li>
                {{end}}
                <li class="dropdown">
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown">{{.User.NickName}} <span class="caret"></span></a>
                    <ul class="dropdown-menu" role="menu">
                        <li><a href="{{.User.Link}}">{{i18n .Lang "nav.user_home_page"}}</a></li>
                        <li><a href="{{.AppUrl}}notification">{{i18n .Lang "notice.my_notice"}}</a></li>
                        <li><a href="{{.AppUrl}}settings/profile">{{i18n .Lang "nav.user_setting_page"}}</a></li>
                        <li class="divider"></li>
                        {{if .User.IsAdmin}}
                            <li><a href="{{.AppUrl}}admin">{{i18n .Lang "admin.admin_center"}}</a></li>
                            <li class="divider"></li>
                        {{end}}
                        <li><a href="{{.AppUrl}}logout">{{i18n .Lang "auth.logout"}}</a></li>
                    </ul>
                </li>
            </ul>

            {{else}}
            <div class="nav navbar-nav navbar-right">
                <a class="btn btn-sm btn-info navbar-btn" href="{{.AppUrl}}register">{{i18n .Lang "auth.register"}}</a> 
                <a class="btn btn-sm btn-primary navbar-btn" style="margin-right:10px;" href="{{.AppUrl}}login">{{i18n .Lang "auth.login"}}</a>
            </div>
            {{end}}
        </div>
    </div>
</nav>
